home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Menu / c / Warn < prev   
Text File  |  1995-07-09  |  1KB  |  36 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Menu.Warn.c
  12.     Author:  Copyright © 1993 Ainsley Pereira
  13.     Version: 1.00 (25 Aug 1993)
  14.     Purpose: Attaches a handler to be called when pointer is about to open a
  15.              submenu.
  16. */
  17.  
  18. #include "DeskLib:Wimp.h"
  19. #include "DeskLib:Event.h"
  20. #include "DeskLib:EventMsg.h"
  21. #include "DeskLib:Menu.h"
  22.  
  23.  
  24. extern void Menu_Warn(menu_ptr menu, int entry, BOOL yesno,
  25.                       event_handler handler, void *reference)
  26. {
  27.   menu_item *item = (menu_item *) (((int) menu) + sizeof(menu_block));
  28.  
  29.   item = &item[entry];
  30.   item->menuflags.data.notifysub = yesno;
  31.   if (yesno)
  32.     EventMsg_Claim(message_MENUWARNING, event_ANY, handler, reference);
  33.   else
  34.     EventMsg_Release(message_MENUWARNING, event_ANY, handler);
  35. }
  36.